#
# Run to move the output etc to the right place for use by ROOT's
# crazy build rules. This is only so in the release we can run.
#

[CmdletBinding()]
param (
[Parameter(mandatory=$true)]
[string] $targetLoc
)

#
# Do this only on release builds
#

if ($targetLoc -match "Release")
{
	$outDirLocation = Split-Path $targetLoc
	$destLoc = Join-Path $outDirLocation "\..\etc"
	$sourceLoc = Join-Path $outDirLocation "\etc"
	if (-not $(Test-Path $sourceLoc))
	{
		Write-Host "ERROR: Unable to find source etc files at $sourceLoc"
		exit
	}
	if (Test-Path $destLoc) {
		Write-Host "Copying the etc directory down a level for ROOT"
		Remove-Item -Recurse $destLoc
	}
	Copy-Item -Recurse $sourceLoc $destLoc
}


